import { NzSafeAny } from 'ng-zorro-antd/core/types';

export interface WidgetConfig {
  field: string;
  imageClass: string;
  status: number;
  title: string;
  minWidth: number;
  minHeight: number;
  defaultWidth: number;
  defaultHeight: number;
  maxWidth: number;
  maxHeight: number;
  tag: string;
  data: NzSafeAny;
  layout?: LayoutPosition;
  configuration?: NzSafeAny;
}

export interface LayoutPosition {
  left: string;
  top: string;
  width: string;
  height: string;
}

export interface RectanglePosition {
  left: number;
  top: number;
  width: number;
  height: number;
}

export interface WidgetType {
  type: string;
  icon: string;
  name: string;
}

const widgetConfigJson: WidgetConfig[] = [
  {
    field: 'serial-chart',
    imageClass: 'serial-chart inner-box',
    status: 0,
    title: '柱状图',
    minWidth: 112,
    minHeight: 77,
    defaultWidth: 225,
    defaultHeight: 155,
    maxWidth: 545,
    maxHeight: 375,
    tag: 'serial-chart',
    data: null
  },
  {
    field: 'word-cloud',
    imageClass: 'word-cloud',
    status: 0,
    title: '词云',
    minWidth: 112,
    minHeight: 77,
    defaultWidth: 225,
    defaultHeight: 155,
    maxWidth: 545,
    maxHeight: 375,
    tag: 'word-cloud',
    data: null
  }
];

const widgetType: WidgetType[] = [
  { type: 'basic', icon: 'highlight', name: '基础' },
  { type: 'canvas', icon: 'pie-chart', name: '图表' }
];

export default { widgetConfigJson, widgetType };
